<div style="width: 690px; margin-left: auto; margin-right: auto; text-align: center; border: solid 1px #dddddd; background: #eeeeee; padding: 10px">
          <form action="/media/search" method="get">
            <div><label for="query" style="font-weight: bold;">Search:</label>
            <%= text_field_tag 'query', params[:query], :size => '75' %>
            <%= submit_tag 'Search' %></div>
          </form>
</div>

<div style="width: 205px; padding: 10px; margin: 5px; margin-left: 0; float: right; border: solid 1px #dddddd;">
  <h3 style="text-align: center; text-decoration: underline; padding-top: 0;">Tags</h3>
  <ul style="padding-left: 10px; padding-top: 10px;">
    <% for @tag in @mediatags do %>
      <li><%= link_to @tag.name, { :action => :search, :tag => @tag.name } %> (<%= @tag.count %>)</li>
    <% end %>
  </ul>
</div>

<div style="width: 220px; padding: 10px; border: solid 1px #dddddd; margin: 5px; margin-right: 0; float: left;">
  <h3 style="text-align: center; text-decoration: underline; padding-top: 0;">Latest Media</h3>
  <ul style="padding-left: 10px; padding-top: 10px;">
    <% for media in @mediaslatest do %>
      <li><%= link_to clean_text(media.title[0,20]), :controller => 'media', :action => 'show', :id => media.id, :permalink => media.permalink  %> (Rating: <%= media.rating %>)</li>
    <% end %>
  </ul>
</div>

<div style="width: 220px; padding: 10px; border: solid 1px #dddddd; margin: 5px; margin-right: 0; float: left;">
  <h3 style="text-align: center; text-decoration: underline; padding-top: 0;">Media by Rating</h3>
  <ul style="padding-left: 10px; padding-top: 10px;">
    <% for media in @mediasbyrating do %>
      <li><%= link_to clean_text(media.title[0,20]), :controller => 'media', :action => 'show', :id => media.id, :permalink => media.permalink  %> (Rating: <%= media.rating %>)</li>
    <% end %>
  </ul>
</div>

<div style="width: 220px; padding: 10px; border: solid 1px #dddddd; margin: 5px; margin-right: 0; float: left;">
  <h3 style="text-align: center; text-decoration: underline; padding-top: 0;">Media by Views</h3>
  <ul style="padding-left: 10px; padding-top: 10px;">
    <% for media in @mediasbyviews do %>
      <li><%= link_to clean_text(media.title[0,20]), :controller => 'media', :action => 'show', :id => media.id, :permalink => media.permalink  %> (<%= media.views %> views)</li>
    <% end %>
  </ul>
</div>
<div style="width: 220px; padding: 10px; border: solid 1px #dddddd; margin: 5px; margin-right: 0; float: left;">
  <h3 style="text-align: center; text-decoration: underline; padding-top: 0;">Random Media</h3>
  <ul style="padding-left: 10px; padding-top: 10px;">
    <% for media in @mediasrandom do %>
      <li><%= link_to clean_text(media.title[0,20]), :controller => 'media', :action => 'show', :id => media.id, :permalink => media.permalink  %> (Rating: <%= media.rating %>)</li>
    <% end %>
  </ul>
</div>